﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BookShop.Models;
namespace BookShop.Controllers
{
    public class BookViewModel
    {
        public Book Book { get; private set; }
        public IQueryable<Comment> Comment { get; private set; }
        public Comment AllComment { get; private set; }
        /// <summary>
        /// 构造函数，构造Book,Comment数据模型
        /// </summary>
        /// <param name="book">图书对象</param>
        /// <param name="comment">评论对象</param>
        public BookViewModel(Book book, IQueryable<Comment> comment)
        {
            Book = book;
            Comment = comment;
        }

        public BookViewModel(Comment allComment)
        {
            AllComment = allComment;
        }
    }
}
